package com.fks.fks_service.mapper;

import com.fks.fks_service.pojo.TransferAccounts;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface TransferAccountsMapper {

    @Insert("insert into fks_transfer_accounts (transferIntoUserId,transferOutUserId,integral,commission" +
            ",createTime) values (#{transferIntoUserId},#{transferOutUserId},#{integral},#{commission}" +
            ",#{nowTime})")
    int addTransferAccounts(int transferIntoUserId, String transferOutUserId
            , String integral, String commission, String nowTime);

    @Select("select * from fks_transfer_accounts where transferIntoUserId=#{userId} or transferOutUserId=#{userId}" +
            " order by createTime desc limit #{page},#{pageSize}")
    List<TransferAccounts> getTransferAccountsList(String userId,int page ,int pageSize);
}
